package com.zqu.controller;


import com.zqu.pojo.ClientType;
import com.zqu.service.ClientTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("clienttype")
public class ClientTypeController {
    @Autowired
    private ClientTypeService clientTypeService;

    @RequestMapping("findclienttype")
    @ResponseBody
    public ClientType selectById(long id){
        return clientTypeService.selectClientTypeById(id);
    }

    @RequestMapping("selectclienttypelist")
    @ResponseBody
    public List<ClientType> selectList(){
        return clientTypeService.selectList(new ClientType());
    }

    @RequestMapping("insertclienttype")
    @ResponseBody
    public boolean insert(){
        return clientTypeService.insertClientType(new ClientType());
    }

    @RequestMapping("updateclienttype")
    @ResponseBody
    public boolean update(){
        return clientTypeService.updateClientType(new ClientType());
    }

    @RequestMapping("deleteclienttype")
    @ResponseBody
    public boolean delete(long id){
        return clientTypeService.deleteClientType(id);
    }

    @RequestMapping("deleteclienttypebyids")
    @ResponseBody
    public boolean deleteByIds(String[] ids){
        return clientTypeService.deleteClientTypeByIds(ids);
    }
}
